var a = getApp();

Page({
    data: {
        name: "",
        lawyer_info: {},
        current_page: 1,
        last_page: 1,
        lawyerId: "",
        text: "距离",
        domainName: "领域名称",
        value1: 0,
        value2: "b",
        option2: [ {
            text: "好评排序",
            value: "好评排序"
        }, {
            text: "销量排序",
            value: "销量排序"
        } ]
    },
    onLoad: function(a) {
        this.setData({
            lawyerId: a.lawyerId
        }), this.getData();
    },
    change: function(a) {
        var t = a.detail;
        this.setData({
            text: t
        });
    },
    domain: function(a) {
        this.selectComponent("#domain").toggle(), this.setData({
            domainName: a.currentTarget.dataset.name
        });
    },
    getData: function() {
        var t = this, e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "", n = a.getNetAddresss("plugin.lawyer-platform.frontend.controllers.lawyer-firm.getLawyerList");
        a._postNetWork({
            url: n,
            data: {
                id: this.data.lawyerId,
                name: e
            },
            success: function(e) {
                console.log(e), 1 == e.data.result ? t.setData({
                    lawyer_info: e.data.data.list,
                    current_page: e.data.data.list.current_page,
                    last_page: e.data.data.list.last_page
                }) : a.tips(e.data.msg);
            }
        });
    },
    onCancel: function() {
        this.setData({
            name: ""
        });
    },
    onChange: function(a) {
        var t = this;
        this.setData({
            name: a.detail
        }), this.data.timerId && clearTimeout(this.data.timerId), this.data.timerId = setTimeout(function() {
            t.getData(a.detail);
        }, 350);
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {
        var t = this;
        if (this.data.current_page >= this.data.last_page) {
            var e = a.getNetAddresss("plugin.lawyer-platform.frontend.controllers.lawyer-firm.getLawyerList");
            a._postNetWork({
                url: e,
                data: {
                    id: this.data.lawyerId,
                    name: searchName
                },
                success: function(e) {
                    1 == e.data.result ? (t.data.lawyer_info.data.concat(e.data.data.list.data), t.setData({
                        lawyer_info: t.data.lawyer_info,
                        current_page: e.data.list.current_page,
                        last_page: e.data.list.last_page
                    })) : a.tips(e.data.msg);
                }
            });
        }
    },
    onShareAppMessage: function() {
        return {
            title: "邀请律师",
            path: "/packageI/lawyerPlatform/info/info?type=lawyerdetail&share=lawyer&merchant_member_id=" + wx.getStorageSync("uid")
        };
    }
});